See https://hbctraining.github.io/Intro-to-ChIPseq/lessons/12_functional_analysis.html

BiocManager::install("ChIPseeker")
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details

replacement repositories:
    CRAN: https://cran.rstudio.com/

Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.2 (2021-11-01)
Installing package(s) 'ChIPseeker'
trying URL 'https://bioconductor.org/packages/3.14/bioc/bin/macosx/contrib/4.1/ChIPseeker_1.30.3.tgz'
Content type 'application/x-gzip' length 6936042 bytes (6.6 MB)
==================================================
downloaded 6.6 MB

The downloaded binary packages are in
    /var/folders/c8/rk9y5xz57x5_t_g3v746g7lm0000gn/T//RtmpnOjNYw/downloaded_packages
Old packages: 'ape', 'BH', 'BiocParallel', 'clusterProfiler', 'DBI', 'fs', 'glue', 'igraph', 'knitr', 'Matrix',
  'openssl', 'pkgbuild', 'RcppArmadillo', 'shadowtext', 'tinytex', 'usethis', 'xfun'
Update all/some/none? [a/s/n]: 
a
Warning: unable to access index for repository https://bioconductor.org/packages/3.14/data/annotation/bin/macosx/contrib/4.1:
  cannot open URL 'https://bioconductor.org/packages/3.14/data/annotation/bin/macosx/contrib/4.1/PACKAGES'
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/ape_5.6.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/ape_5.6.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/ape_5.6.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘ape’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/BH_1.78.0-0.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/BH_1.78.0-0.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/BH_1.78.0-0.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘BH’ failed
trying URL 'https://bioconductor.org/packages/3.14/bioc/bin/macosx/contrib/4.1/BiocParallel_1.28.3.tgz'
Content type 'application/x-gzip' length 1375804 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'https://bioconductor.org/packages/3.14/bioc/bin/macosx/contrib/4.1/clusterProfiler_4.2.1.tgz'
Content type 'application/x-gzip' length 711666 bytes (694 KB)
==================================================
downloaded 694 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/DBI_1.1.2.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/DBI_1.1.2.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/DBI_1.1.2.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘DBI’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/fs_1.5.2.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/fs_1.5.2.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/fs_1.5.2.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘fs’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/glue_1.6.0.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/glue_1.6.0.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/glue_1.6.0.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘glue’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/igraph_1.2.10.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/igraph_1.2.10.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/igraph_1.2.10.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘igraph’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/knitr_1.37.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/knitr_1.37.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/knitr_1.37.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘knitr’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/Matrix_1.4-0.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/Matrix_1.4-0.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/Matrix_1.4-0.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘Matrix’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/openssl_1.4.6.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/openssl_1.4.6.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/openssl_1.4.6.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘openssl’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/pkgbuild_1.3.1.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/pkgbuild_1.3.1.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/pkgbuild_1.3.1.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘pkgbuild’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/RcppArmadillo_0.10.7.5.0.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/RcppArmadillo_0.10.7.5.0.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/RcppArmadillo_0.10.7.5.0.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘RcppArmadillo’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/shadowtext_0.1.0.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/shadowtext_0.1.0.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/shadowtext_0.1.0.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘shadowtext’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/tinytex_0.36.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/tinytex_0.36.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/tinytex_0.36.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘tinytex’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/usethis_2.1.5.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/usethis_2.1.5.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/usethis_2.1.5.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘usethis’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/xfun_0.29.tgz'
Warning in download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/xfun_0.29.tgz': status was 'Couldn't resolve host name'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/xfun_0.29.tgz'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘xfun’ failed

The downloaded binary packages are in
    /var/folders/c8/rk9y5xz57x5_t_g3v746g7lm0000gn/T//RtmpnOjNYw/downloaded_packages
library(org.Hs.eg.db)
peakAnno <- annotatePeak(peakfile, tssRegion=c(-3000, 3000), TxDb=txdb)
>> loading peak file...              2021-12-23 20:14:39 
>> preparing features information...         2021-12-23 20:14:39 
>> identifying nearest features...       2021-12-23 20:14:40 
>> calculating distance from peak to TSS...  2021-12-23 20:14:41 
>> assigning genomic annotation...       2021-12-23 20:14:41 
>> assigning chromosome lengths          2021-12-23 20:15:08 
>> done...                   2021-12-23 20:15:08 

peakAnnoDf <- data.frame(peakAnno@anno)
peakEntrez <- peakAnnoDf$geneId
annotations_edb <- AnnotationDbi::select(EnsDb.Hsapiens.v75,
                                         keys = peakEntrez,
                                         columns = c("GENENAME"),
                                         keytype = "ENTREZID")
annotations_edb$ENTREZID <- as.character(annotations_edb$ENTREZID)
ego <- enrichGO(gene = peakEntrez, 
                    keyType = "ENTREZID", 
                    OrgDb = org.Hs.eg.db, 
                    ont = "BP", 
                    pAdjustMethod = "BH", 
                    qvalueCutoff = 0.05, 
                    readable = TRUE)

ekegg <- enrichKEGG(gene = peakEntrez,
                 organism = 'hsa',
                 pvalueCutoff = 0.05)
Reading KEGG annotation online:

Reading KEGG annotation online:
ekegg <- enrichKEGG(gene = peakEntrez,
                 organism = 'hsa',
                 pvalueCutoff = 0.05)
dotplot(ekegg)

promoter <- getPromoters(TxDb=txdb, upstream=3000, downstream=3000)
promoter <- getPromoters(TxDb=txdb, upstream=3000, downstream=3000)
tagMatrix <- getTagMatrix(peakAnno@anno, windows=promoter)
>> preparing start_site regions by ... 2021-12-22 21:54:07
>> preparing tag matrix...  2021-12-22 21:54:07 
plotAvgProf(tagMatrix, xlim=c(-3000, 3000), conf = 0.95, resample = 1000)
>> plotting figure...            2021-12-22 21:55:08 
>> Running bootstrapping for tag matrix...       2021-12-22 21:55:27 

plotPeakProf2(peak = peakAnno@anno, upstream = rel(0.2), downstream = rel(0.2),
              conf = 0.95, by = "gene", type = "body", nbin = 800,
              TxDb = txdb, weightCol = "V5",ignore_strand = F)
>> binning method is used...2021-12-22 21:55:45
>> preparing body regions by gene... 2021-12-22 21:55:45
>> preparing tag matrix by binning...  2021-12-22 21:55:45 
>> preparing matrix with extension from (TSS-20%)~(TTS+20%)... 2021-12-22 21:55:45
>> 52 peaks(1.028074%), having lengths smaller than 800bp, are filtered... 2021-12-22 21:55:57
>> Running bootstrapping for tag matrix...       2021-12-22 21:59:02 

intron_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = rel(0.2),
                           downstream = rel(0.2), 
                           by = "intron",
                           type = "body",
                           nbin = 100,
                           )
>> binning method is used...2021-12-22 22:08:56
>> preparing body regions by intron... 2021-12-22 22:08:56
>> preparing tag matrix by binning...  2021-12-22 22:08:56 
>> preparing matrix with extension from (TSS-20%)~(TTS+20%)... 2021-12-22 22:08:56
>> 51 peaks(0.1213997%), having lengths smaller than 100bp, are filtered... 2021-12-22 22:09:11
intron_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = rel(0.2),
                           downstream = rel(0.2), 
                           by = "intron",
                           type = "body",
                           nbin = 100,
                           )
>> binning method is used...2021-12-22 22:14:45
>> preparing body regions by intron... 2021-12-22 22:14:45
>> preparing tag matrix by binning...  2021-12-22 22:14:45 
>> preparing matrix with extension from (TSS-20%)~(TTS+20%)... 2021-12-22 22:14:46
>> 51 peaks(0.1213997%), having lengths smaller than 100bp, are filtered... 2021-12-22 22:15:03
plotPeakProf(tagMatrix = intron_matrix, conf = 0.95)
>> Running bootstrapping for tag matrix...       2021-12-22 22:20:50 

intron_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "intron",
                           type = "start_site",
                           nbin = 250,
                           )
>> binning method is used...2021-12-22 22:32:52
>> preparing start_site regions by intron... 2021-12-22 22:32:52
>> preparing tag matrix by binning...  2021-12-22 22:32:52 
intron_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "intron",
                           type = "start_site",
                           nbin = 250,
                           )
>> binning method is used...2021-12-22 22:32:57
>> preparing start_site regions by intron... 2021-12-22 22:32:57
>> preparing tag matrix by binning...  2021-12-22 22:32:57 
plotPeakProf(tagMatrix = intron_matrix, conf = 0.95)
>> Running bootstrapping for tag matrix...       2021-12-22 22:33:04 

plotPeakProf(tagMatrix = intron_matrix, conf = 0.95)
>> Running bootstrapping for tag matrix...       2021-12-22 22:47:02 

plotPeakProf(tagMatrix = exon_matrix, conf = 0.95)
>> Running bootstrapping for tag matrix...       2021-12-22 22:44:29 

exon_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "exon",
                           type = "start_site",
                           nbin=250
                           )
>> binning method is used...2021-12-22 23:31:27
>> preparing start_site regions by exon... 2021-12-22 23:31:27
>> preparing tag matrix by binning...  2021-12-22 23:31:27 
exon_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "exon",
                           type = "start_site",
                           nbin=250
                           )
>> binning method is used...2021-12-22 23:31:34
>> preparing start_site regions by exon... 2021-12-22 23:31:34
>> preparing tag matrix by binning...  2021-12-22 23:31:34 
plotPeakProf(exon_matrix, xlab="Exon start (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
>> Running bootstrapping for tag matrix...       2021-12-22 23:31:48 

exon_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "exon",
                           type = "end_site",
                           nbin=250
                           )
>> binning method is used...2021-12-22 23:31:49
>> preparing end_site regions by exon... 2021-12-22 23:31:49
>> preparing tag matrix by binning...  2021-12-22 23:31:49 
plotPeakProf(exon_matrix, xlab="Exon end (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
>> Running bootstrapping for tag matrix...       2021-12-22 23:32:08 

utr_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "3UTR",
                           type = "start_site",
                           nbin=250
                           )
>> binning method is used...2021-12-22 23:34:17
>> preparing start_site regions by 3UTR... 2021-12-22 23:34:17
>> preparing tag matrix by binning...  2021-12-22 23:34:17 
utr_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "3UTR",
                           type = "start_site",
                           nbin=250
                           )
>> binning method is used...2021-12-22 23:34:27
>> preparing start_site regions by 3UTR... 2021-12-22 23:34:27
>> preparing tag matrix by binning...  2021-12-22 23:34:27 
plotPeakProf(utr_matrix, xlab="3' UTR start (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
>> Running bootstrapping for tag matrix...       2021-12-22 23:34:33 

utr_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "3UTR",
                           type = "end_site",
                           nbin=250
                           )

plotPeakProf(utr_matrix, xlab="3' UTR end (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
utr_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "5UTR",
                           type = "start_site",
                           nbin=250
                           )
>> binning method is used...2021-12-22 23:36:22
>> preparing start_site regions by 5UTR... 2021-12-22 23:36:22
>> preparing tag matrix by binning...  2021-12-22 23:36:22 
utr_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "5UTR",
                           type = "start_site",
                           nbin=250
                           )
>> binning method is used...2021-12-22 23:36:29
>> preparing start_site regions by 5UTR... 2021-12-22 23:36:29
>> preparing tag matrix by binning...  2021-12-22 23:36:29 
plotPeakProf(utr_matrix, xlab="5' UTR start (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
>> Running bootstrapping for tag matrix...       2021-12-22 23:36:35 

utr_matrix <- getTagMatrix(peak = peakAnno@anno, 
                           TxDb = txdb,
                           upstream = 1000,
                           downstream = 1000, 
                           by = "5UTR",
                           type = "end_site",
                           nbin=250
                           )

plotPeakProf(utr_matrix, xlab="5' UTR end (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
plotPeakProf(gene_matrix, xlab="Gene start (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
>> Running bootstrapping for tag matrix...       2021-12-23 20:16:29 

plotPeakProf(gene_matrix, xlab="Gene end (5'->3')", ylab = "Peak Frequency", conf = 0.95, resample = 1000)
>> Running bootstrapping for tag matrix...       2021-12-23 20:16:06 

LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKU2VlIGh0dHBzOi8vaGJjdHJhaW5pbmcuZ2l0aHViLmlvL0ludHJvLXRvLUNoSVBzZXEvbGVzc29ucy8xMl9mdW5jdGlvbmFsX2FuYWx5c2lzLmh0bWwKCmBgYHtyfQpCaW9jTWFuYWdlcjo6aW5zdGFsbCgiQ2hJUHNlZWtlciIpCkJpb2NNYW5hZ2VyOjppbnN0YWxsKCJHTy5kYiIpCkJpb2NNYW5hZ2VyOjppbnN0YWxsKCJETy5kYiIpCkJpb2NNYW5hZ2VyOjppbnN0YWxsKCJFbnNEYi5Ic2FwaWVucy52NzUiKQpCaW9jTWFuYWdlcjo6aW5zdGFsbCgiY2x1c3RlclByb2ZpbGVyIikKQmlvY01hbmFnZXI6Omluc3RhbGwoIm9yZy5Icy5lZy5kYiIpCkJpb2NNYW5hZ2VyOjppbnN0YWxsKCJUeERiLkhzYXBpZW5zLlVDU0MuaGczOC5rbm93bkdlbmUiKQpgYGAKCgpgYGB7cn0KbGlicmFyeShDaElQc2Vla2VyKQpsaWJyYXJ5KFR4RGIuSHNhcGllbnMuVUNTQy5oZzM4Lmtub3duR2VuZSkKbGlicmFyeShFbnNEYi5Ic2FwaWVucy52NzUpCmxpYnJhcnkoY2x1c3RlclByb2ZpbGVyKQpsaWJyYXJ5KEFubm90YXRpb25EYmkpCmxpYnJhcnkob3JnLkhzLmVnLmRiKQpgYGAKCmBgYHtyfQp0eGRiIDwtIFR4RGIuSHNhcGllbnMuVUNTQy5oZzM4Lmtub3duR2VuZQpwZWFrZmlsZSA8LSAiLi4vZGF0YS9yYXcvZWNsaXAvUlBMMjItWlI3NTFfY2xlYXJDTElQLnBvb2wudGFnLnVuaXEuZGVsLkNJTVMuZmRyMTAuZjEwLmJlZCIKcGVha0Fubm8gPC0gYW5ub3RhdGVQZWFrKHBlYWtmaWxlLCB0c3NSZWdpb249YygtMzAwMCwgMzAwMCksIFR4RGI9dHhkYikKYGBgCmBgYHtyfQpwbG90QW5ub0JhcihwZWFrQW5ubykKYGBgCgpgYGB7cn0KcGxvdERpc3RUb1RTUyhwZWFrQW5ubykKYGBgCmBgYHtyfQpwZWFrQW5ub0RmIDwtIGRhdGEuZnJhbWUocGVha0Fubm9AYW5ubykKcGVha0VudHJleiA8LSBwZWFrQW5ub0RmJGdlbmVJZAphbm5vdGF0aW9uc19lZGIgPC0gQW5ub3RhdGlvbkRiaTo6c2VsZWN0KEVuc0RiLkhzYXBpZW5zLnY3NSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlzID0gcGVha0VudHJleiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5zID0gYygiR0VORU5BTUUiKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXl0eXBlID0gIkVOVFJFWklEIikKYW5ub3RhdGlvbnNfZWRiJEVOVFJFWklEIDwtIGFzLmNoYXJhY3Rlcihhbm5vdGF0aW9uc19lZGIkRU5UUkVaSUQpCmBgYAoKYGBge3J9CmVnbyA8LSBlbnJpY2hHTyhnZW5lID0gcGVha0VudHJleiwgCiAgICAgICAgICAgICAgICAgICAga2V5VHlwZSA9ICJFTlRSRVpJRCIsIAogICAgICAgICAgICAgICAgICAgIE9yZ0RiID0gb3JnLkhzLmVnLmRiLCAKICAgICAgICAgICAgICAgICAgICBvbnQgPSAiQlAiLCAKICAgICAgICAgICAgICAgICAgICBwQWRqdXN0TWV0aG9kID0gIkJIIiwgCiAgICAgICAgICAgICAgICAgICAgcXZhbHVlQ3V0b2ZmID0gMC4wNSwgCiAgICAgICAgICAgICAgICAgICAgcmVhZGFibGUgPSBUUlVFKQpgYGAKCmBgYHtyfQpkb3RwbG90KGVnbywgc2hvd0NhdGVnb3J5PTI1KQoKYGBgCgpgYGB7cn0KZWtlZ2cgPC0gZW5yaWNoS0VHRyhnZW5lID0gcGVha0VudHJleiwKICAgICAgICAgICAgICAgICBvcmdhbmlzbSA9ICdoc2EnLAogICAgICAgICAgICAgICAgIHB2YWx1ZUN1dG9mZiA9IDAuMDUpCgpkb3RwbG90KGVrZWdnKQpgYGAKCmBgYHtyfQpwcm9tb3RlciA8LSBnZXRQcm9tb3RlcnMoVHhEYj10eGRiLCB1cHN0cmVhbT0zMDAwLCBkb3duc3RyZWFtPTMwMDApCmV4b24gPC0gZ2V0SShUeERiPXR4ZGIsIHVwc3RyZWFtPTMwMDAsIGRvd25zdHJlYW09MzAwMCkKdGFnTWF0cml4IDwtIGdldFRhZ01hdHJpeChwZWFrQW5ub0Bhbm5vLCB3aW5kb3dzPXByb21vdGVyKQoKYGBgCgpgYGB7cn0KcGxvdEF2Z1Byb2YodGFnTWF0cml4LCB4bGltPWMoLTMwMDAsIDMwMDApLCBjb25mID0gMC45NSwgcmVzYW1wbGUgPSAxMDAwKQpgYGAKCmBgYHtyfQpwbG90UGVha1Byb2YyKHBlYWsgPSBwZWFrQW5ub0Bhbm5vLCB1cHN0cmVhbSA9IHJlbCgwLjIpLCBkb3duc3RyZWFtID0gcmVsKDAuMiksCiAgICAgICAgICAgICAgY29uZiA9IDAuOTUsIGJ5ID0gImdlbmUiLCB0eXBlID0gImJvZHkiLCBuYmluID0gODAwLAogICAgICAgICAgICAgIFR4RGIgPSB0eGRiLCB3ZWlnaHRDb2wgPSAiVjUiLGlnbm9yZV9zdHJhbmQgPSBGKQpgYGAKCmBgYHtyfQppbnRyb25fbWF0cml4IDwtIGdldFRhZ01hdHJpeChwZWFrID0gcGVha0Fubm9AYW5ubywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFR4RGIgPSB0eGRiLAogICAgICAgICAgICAgICAgICAgICAgICAgICB1cHN0cmVhbSA9IHJlbCgwLjIpLAogICAgICAgICAgICAgICAgICAgICAgICAgICBkb3duc3RyZWFtID0gcmVsKDAuMiksIAogICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICJpbnRyb24iLAogICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gImJvZHkiLAogICAgICAgICAgICAgICAgICAgICAgICAgICBuYmluID0gMTAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICApCgpwbG90UGVha1Byb2YodGFnTWF0cml4ID0gaW50cm9uX21hdHJpeCwgY29uZiA9IDAuOTUpCmBgYAoKYGBge3J9CmludHJvbl9tYXRyaXggPC0gZ2V0VGFnTWF0cml4KHBlYWsgPSBwZWFrQW5ub0Bhbm5vLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgVHhEYiA9IHR4ZGIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtID0gMTAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnN0cmVhbSA9IDEwMDAsIAogICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICJpbnRyb24iLAogICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gInN0YXJ0X3NpdGUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICBuYmluID0gMjUwLAogICAgICAgICAgICAgICAgICAgICAgICAgICApCgpwbG90UGVha1Byb2YodGFnTWF0cml4ID0gaW50cm9uX21hdHJpeCwgY29uZiA9IDAuOTUpCmBgYApgYGB7cn0KaW50cm9uX21hdHJpeCA8LSBnZXRUYWdNYXRyaXgocGVhayA9IHBlYWtBbm5vQGFubm8sIAogICAgICAgICAgICAgICAgICAgICAgICAgICBUeERiID0gdHhkYiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBzdHJlYW0gPSAxMDAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICBkb3duc3RyZWFtID0gMTAwMCwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5ID0gImludHJvbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSAiZW5kX3NpdGUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICBuYmluID0gMjUwLAogICAgICAgICAgICAgICAgICAgICAgICAgICApCgpwbG90UGVha1Byb2YodGFnTWF0cml4ID0gaW50cm9uX21hdHJpeCwgY29uZiA9IDAuOTUpCmBgYAoKYGBge3J9CmV4b25fbWF0cml4IDwtIGdldFRhZ01hdHJpeChwZWFrID0gcGVha0Fubm9AYW5ubywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFR4RGIgPSB0eGRiLAogICAgICAgICAgICAgICAgICAgICAgICAgICB1cHN0cmVhbSA9IDEwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd25zdHJlYW0gPSAxMDAwLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgYnkgPSAiZXhvbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSAic3RhcnRfc2l0ZSIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG5iaW4gPSAyNTAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICkKCnBsb3RQZWFrUHJvZih0YWdNYXRyaXggPSBleG9uX21hdHJpeCwgY29uZiA9IDAuOTUpCmBgYApgYGB7cn0KZXhvbl9tYXRyaXggPC0gZ2V0VGFnTWF0cml4KHBlYWsgPSBwZWFrQW5ub0Bhbm5vLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgVHhEYiA9IHR4ZGIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtID0gMTAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnN0cmVhbSA9IDEwMDAsIAogICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICJleG9uIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICJzdGFydF9zaXRlIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgbmJpbj0yNTAKICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoKcGxvdFBlYWtQcm9mKGV4b25fbWF0cml4LCB4bGFiPSJFeG9uIHN0YXJ0ICg1Jy0+MycpIiwgeWxhYiA9ICJQZWFrIEZyZXF1ZW5jeSIsIGNvbmYgPSAwLjk1LCByZXNhbXBsZSA9IDEwMDApCmBgYApgYGB7cn0KZXhvbl9tYXRyaXggPC0gZ2V0VGFnTWF0cml4KHBlYWsgPSBwZWFrQW5ub0Bhbm5vLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgVHhEYiA9IHR4ZGIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtID0gMTAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnN0cmVhbSA9IDEwMDAsIAogICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICJleG9uIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICJlbmRfc2l0ZSIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG5iaW49MjUwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICkKCnBsb3RQZWFrUHJvZihleG9uX21hdHJpeCwgeGxhYj0iRXhvbiBlbmQgKDUnLT4zJykiLCB5bGFiID0gIlBlYWsgRnJlcXVlbmN5IiwgY29uZiA9IDAuOTUsIHJlc2FtcGxlID0gMTAwMCkKYGBgCgpgYGB7cn0KdXRyX21hdHJpeCA8LSBnZXRUYWdNYXRyaXgocGVhayA9IHBlYWtBbm5vQGFubm8sIAogICAgICAgICAgICAgICAgICAgICAgICAgICBUeERiID0gdHhkYiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBzdHJlYW0gPSAxMDAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICBkb3duc3RyZWFtID0gMTAwMCwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5ID0gIjNVVFIiLAogICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gInN0YXJ0X3NpdGUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICBuYmluPTI1MAogICAgICAgICAgICAgICAgICAgICAgICAgICApCgpwbG90UGVha1Byb2YodXRyX21hdHJpeCwgeGxhYj0iMycgVVRSIHN0YXJ0ICg1Jy0+MycpIiwgeWxhYiA9ICJQZWFrIEZyZXF1ZW5jeSIsIGNvbmYgPSAwLjk1LCByZXNhbXBsZSA9IDEwMDApCmBgYAoKYGBge3J9CnV0cl9tYXRyaXggPC0gZ2V0VGFnTWF0cml4KHBlYWsgPSBwZWFrQW5ub0Bhbm5vLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgVHhEYiA9IHR4ZGIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtID0gMTAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnN0cmVhbSA9IDEwMDAsIAogICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICIzVVRSIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICJlbmRfc2l0ZSIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG5iaW49MjUwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICkKCnBsb3RQZWFrUHJvZih1dHJfbWF0cml4LCB4bGFiPSIzJyBVVFIgZW5kICg1Jy0+MycpIiwgeWxhYiA9ICJQZWFrIEZyZXF1ZW5jeSIsIGNvbmYgPSAwLjk1LCByZXNhbXBsZSA9IDEwMDApCmBgYAoKYGBge3J9CnV0cl9tYXRyaXggPC0gZ2V0VGFnTWF0cml4KHBlYWsgPSBwZWFrQW5ub0Bhbm5vLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgVHhEYiA9IHR4ZGIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtID0gMTAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnN0cmVhbSA9IDEwMDAsIAogICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICI1VVRSIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICJzdGFydF9zaXRlIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgbmJpbj0yNTAKICAgICAgICAgICAgICAgICAgICAgICAgICAgKQoKcGxvdFBlYWtQcm9mKHV0cl9tYXRyaXgsIHhsYWI9IjUnIFVUUiBzdGFydCAoNSctPjMnKSIsIHlsYWIgPSAiUGVhayBGcmVxdWVuY3kiLCBjb25mID0gMC45NSwgcmVzYW1wbGUgPSAxMDAwKQpgYGAKCmBgYHtyfQp1dHJfbWF0cml4IDwtIGdldFRhZ01hdHJpeChwZWFrID0gcGVha0Fubm9AYW5ubywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFR4RGIgPSB0eGRiLAogICAgICAgICAgICAgICAgICAgICAgICAgICB1cHN0cmVhbSA9IDEwMDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd25zdHJlYW0gPSAxMDAwLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgYnkgPSAiNVVUUiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSAiZW5kX3NpdGUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICBuYmluPTI1MAogICAgICAgICAgICAgICAgICAgICAgICAgICApCgpwbG90UGVha1Byb2YodXRyX21hdHJpeCwgeGxhYj0iNScgVVRSIGVuZCAoNSctPjMnKSIsIHlsYWIgPSAiUGVhayBGcmVxdWVuY3kiLCBjb25mID0gMC45NSwgcmVzYW1wbGUgPSAxMDAwKQpgYGAKCmBgYHtyfQpnZW5lX21hdHJpeCA8LSBnZXRUYWdNYXRyaXgocGVhayA9IHBlYWtBbm5vQGFubm8sIAogICAgICAgICAgICAgICAgICAgICAgICAgICBUeERiID0gdHhkYiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBzdHJlYW0gPSAxMDAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICBkb3duc3RyZWFtID0gMTAwMCwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5ID0gImdlbmUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gInN0YXJ0X3NpdGUiLAogICAgICAgICAgICAgICAgICAgICAgICAgICBuYmluPTI1MAogICAgICAgICAgICAgICAgICAgICAgICAgICApCgpwbG90UGVha1Byb2YoZ2VuZV9tYXRyaXgsIHhsYWI9IkdlbmUgc3RhcnQgKDUnLT4zJykiLCB5bGFiID0gIlBlYWsgRnJlcXVlbmN5IiwgY29uZiA9IDAuOTUsIHJlc2FtcGxlID0gMTAwMCkKYGBgCgpgYGB7cn0KZ2VuZV9tYXRyaXggPC0gZ2V0VGFnTWF0cml4KHBlYWsgPSBwZWFrQW5ub0Bhbm5vLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgVHhEYiA9IHR4ZGIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwc3RyZWFtID0gMTAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnN0cmVhbSA9IDEwMDAsIAogICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICJnZW5lIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICJlbmRfc2l0ZSIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG5iaW49MjUwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICkKCnBsb3RQZWFrUHJvZihnZW5lX21hdHJpeCwgeGxhYj0iR2VuZSBlbmQgKDUnLT4zJykiLCB5bGFiID0gIlBlYWsgRnJlcXVlbmN5IiwgY29uZiA9IDAuOTUsIHJlc2FtcGxlID0gMTAwMCkKYGBg